package com.ddone.ioc.xml.dao.impl;

import com.ddone.ioc.xml.dao.UserDao;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author ddone
 * @date 2024/3/19-17:42
 */
@Repository
@Slf4j
public class UserDaoImpl implements UserDao {

    @Autowired
    private SqlSessionFactory sqlSessionFactory;

    @Override
    public void queryUser(String username, String pwd) {
       log.warn("UserDaoImpl.queryUser");
        String result = "root".equals(username) && "123".equals(pwd)? "登录成功！" : "登录失败！";
        log.warn("result= "+result);
        SqlSession session = sqlSessionFactory.openSession();
        log.warn("session = " + session);
    }
}
